(function() {
  var __hasProp = {}.hasOwnProperty,
    __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };

  this.CategoryNavigationView = (function(_super) {

    __extends(CategoryNavigationView, _super);

    function CategoryNavigationView() {
      return CategoryNavigationView.__super__.constructor.apply(this, arguments);
    }

    CategoryNavigationView.prototype.initialize = function() {
      CategoryNavigationView.__super__.initialize.apply(this, arguments);
      this.model.bind("change", this.render);
      return this.model.fetch();
    };

    CategoryNavigationView.prototype.events = {
      "click li.parent>a": "toggle"
    };

    CategoryNavigationView.prototype.toggle = function(e) {
      e.preventDefault();
      return $(e.target).closest("li.parent").find("li.child").toggle("blind");
    };

    CategoryNavigationView.prototype.render = function() {
      var _this = this;
      return this.GetTemplate(SiteMap.Categories.NavigationTemplate, function(compiledTemplate) {
        return $(_this.el).html(compiledTemplate(_this.model.toJSON()));
      });
    };

    return CategoryNavigationView;

  })(CustomView);

}).call(this);
